#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int removeElement(int* nums, int numsSize, int val)
{
    int* p = nums;
    int count = 0;
    int len = numsSize;
    int kk = len;
    int xx = 0;
    while (xx++ != kk)
    {
        if (*p == val)
        {
            for (int i = count; i < len - 1; i++)
            {
                nums[i] = nums[i + 1];
            }
            count++;
            len--;
        }
        else
        {
            p++;
        }
    }
    return numsSize - count;
}

int main()
{
    int arr[4] = { 3,2,2,3 };
    int len = sizeof(arr) / sizeof(arr[0]);

    int x = removeElement(arr,len, 3);
    printf("%d\n", x);
    return 0;
}